<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<logic:notPresent name="user" scope="session">
	<logic:redirect href="../createUser.do"></logic:redirect>
</logic:notPresent>

<logic:present name="user" scope="session">

	<c:if test="${sessionScope.user.role != 3}">
		<logic:redirect href="info_pages/not_exist.jsp"></logic:redirect>	
	</c:if>	

<html>
<head>
    <link rel= "stylesheet" type="text/css" href="CSS/login.css" />
    <script type="text/javascript" src="JS/login.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Вход</title>
</head>

<body onmousemove="handle()">
<div  align="center">
  <div  class="header" align="center">
    <b>Регистрация / Вход</b>
  </div>

  <div  align="center" class="public">
  <div  class="login">
  <html:form action="/pages/login" style="vertical-align: middle">
        <label>&nbsp;&nbsp;&nbsp;&nbsp; Имя:&nbsp;
        	<html:text property="login" onkeydown="handle()" onkeyup="handle()" onblur="handle()" onfocus="handle()"/>
        </label><br><br>
        <label>Пароль:&nbsp;
        	<html:password property="password" onkeydown="handle()" onkeyup="handle()" onblur="handle()" onfocus="handle()"/>
        </label><br><br>
		
		<input type="submit" value="Вход" name="login_submit" class="buttonLogin" disabled="disabled"  />
    </html:form>

  </div>

  <div class="register" >

        <a href="register.jsp">
        <input type="button" value="Регистрация" class="buttonRegister" />
        </a>

  </div>
  </div>

</div>
</body>

</html>
</logic:present>